package Trip;

import com.alibaba.fastjson.JSON;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;

public class Text_Json {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new FileReader("E:\\data\\data.txt"));
        BufferedWriter bw = new BufferedWriter(new FileWriter("E:\\data\\data_trip.json"));
        String line;
        Trip trip = new Trip();
        while ((line = br.readLine()) != null) {
            String[] data = line.split("\t", -1);
            trip.set(data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7], data[8], data[9], data[10], data[11], data[12]);
            String json = JSON.toJSONString(trip);
            bw.write(json);
            bw.write("\n");
            bw.flush();
        }
        br.close();
        bw.close();
    }
}
